﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Lesson02
{
    public partial class _Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }
        protected void Page_PreInit(object sender, EventArgs e)
        {
            if (this.Session["theme"] != null)
            {
                this.Theme = this.Session["theme"].ToString();
            }
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            if (this.Session["theme"] == null)
                this.Session["theme"] = "Blue";

            if (this.Session["theme"].ToString() == "Green")
                this.Session["theme"] = "Blue";
            else
                this.Session["theme"] = "Green";
            this.Server.Transfer(this.Request.Path);
        }
    }
}
